package wiki.generic.concretecontents;

import java.util.List;

import wiki.generic.contents.Content;
import wiki.generic.med.GeneralPurposeService;
import wiki.generic.med.ViewingService;
/**
 * 
 * @author <p><strong>JwTeam</strong></p> 
 *
 */
public class Youtube extends ConcreteContent{

	private ViewingService ps;
	private GeneralPurposeService gps;
	
	public Youtube(String nome, String type, int ID, List<String> attributes, ViewingService ps, GeneralPurposeService gps) {
		super(nome, type, ID, attributes);
		this.ps=ps;
		this.gps=gps;
	}

	@Override
	public String getHTMLCode() {
		String code="<iframe class='video' width='560' height='315' src='";
		code+="http://www.youtube.com/embed/";
		String s=gps.getFileName(ps.getContentMainParameterbyID(type, ID).getInfo());
		code+=s+"?rel=0";
		code+="' frameborder='0' allowfullscreen></iframe>";
		return code;
	}

	@Override
	public Content clone() {
		return new Youtube(nome, type, ID, attributes, ps,gps);
	}

	
}
